package cn.sh.yhk;

import cn.sh.yhk.model.Student;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

/**
 * @Auther: adminyhk
 * @Date: 2018/11/11 16:22
 * @Description:
 */
@SpringBootApplication
@EnableAdminServer
@ResponseBody
@RestController
public class AdminApplication {
    public static List<String> list = new ArrayList<>();
    @Autowired
    private StarterService starterService;

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

    @PostConstruct
    public void home() {
        System.out.println("===============");
    }

    @RequestMapping("/2")
    public List<String> asda() {
        Student[] array = new Student[1000000000];
        System.out.println(array);
        return list;
    }

    @RequestMapping("/3")
    public String asdAa() {
        System.gc();
        return "OK";
    }
}
